import 'package:flutter/material.dart';
import 'package:flutter_music/pages/home/home.dart';
import 'package:flutter_music/pages/home/providers/songs_provider.dart';
import 'package:flutter_music/themes/theme_provider.dart';
import 'package:provider/provider.dart';

void main() {
  runApp(
    MultiProvider(
      providers: [
        ChangeNotifierProvider(create: (context) => ThemeProvider()),
        ChangeNotifierProvider(create: (context) => SongsProvider()),
      ],
      child: const RootPage(),
    ),
  );
}

class RootPage extends StatelessWidget {
  const RootPage({
    super.key,
  });

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Music',
      debugShowCheckedModeBanner: false,
      theme: Provider.of<ThemeProvider>(context).currentThemeMode,
      home: const HomePage(),
    );
  }
}
